const Http = require('./http');
const Api= require('./api');

class MessageService {
  static getMsgList(openid,page) {
    return Http.request({
      url: Api.getMsgList,
      data: {openid:openid,page:page,project_type:4}
    });
  }

  static getMsgDetail(openid,msgid,status) {
    return Http.request({
      url: Api.getMsgDetail,
      data: {
        project_type:4,
        openid: openid,
        msg_id: msgid,
        status: status
      }
    });
  }
  static getUnreadConsumerMsgSum(openid) {
        return Http.request({
            url: Api.getUnreadConsumerMsgSum,
            data: {
                openid: openid,
                project_type:4
            }
        });
  }
  static getAllMsgList(openid) {
        return Http.request({
            url: Api.getAllMsgList,
            data: {
                openid: openid,
                project_type:4
            }
        });
  }

  static addFormlotteryMachine(data) {
    data.project_type = 4;
    return Http.request({
      url: Api.addFormlotteryMachine,
      data: data
    });
  }

  static getStoreType(openid) {
    return Http.request({
      url: Api.getStoreType,
      data: {
        openid: openid,
        project_type: 4
      }
    });
  }

static getFormlotteryMachine(data) {
    return Http.request({
      url: Api.getFormlotteryMachine,
      data: data
    });
  }

static getVerifyCodeUser(data) {
    return Http.request({
      url: Api.getVerifyCodeUser,
      data: data
    });
  }

  static addFormTail(data) {
    return Http.request({
      url: Api.addFormTail,
      data: data
    });
  }

  static getFormTail(data) {
    return Http.request({
      url: Api.getFormTail,
      data: data
    });
  }

  static getMsgList(openid,page) {
    return Http.request({
      url: Api.getMsgList,
      data: {
        openid: openid,
        project_type:4,
        page:page
      }
    });
  }
    
  static getProblemList(openid,page) {
    return Http.request({
      url: Api.getProblemList,
      data: {
        openid: openid,
        project_type:4,
        page:page
      }
    });
  }
  static checkReferee(data) {
    return Http.request({
      url: Api.checkReferee,
      data: data
    });
  }
}
module.exports = MessageService;